#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 crane <crane@gosun>
#
# Distributed under terms of the MIT license.

"""

"""

class VerticleSolution:
    def __init__(self, num1, num2):
        self.cnt_results = 10 * [0]
        self.num1 = num1
        self.num2 = num2

    def do(self):
        self.cnt(self.num1)
        self.cnt(self.num2)

        n = self.num2
        while n:
            digit = n % 10
            n //= 10
            self.cnt(digit * self.num1)

        self.cnt(self.num1 * self.num2)

    def cnt(self, num):
        n = num
        while n:
            digit = n % 10
            n //= 10
            self.cnt_results[digit] += 1


def test():
    n1 = 123
    n2 = 456
    s = VerticleSolution(n1, n2)
    s.do()
    print(s.cnt_results[1:])            # HINT: 不需要0

def main():
    print("start main")
    test()

if __name__ == "__main__":
    main()
